{extend name="../../admin/view/main"}

{block name="button"}

<button data-modal='{:url("add")}' data-width="1200px" data-height="80%" data-title="添加型号" class='layui-btn layui-btn-sm layui-btn-primary'>添加型号</button>


<button data-action='{:url("remove")}' data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>删除型号</button>

{/block}

{block name="content"}
{include file='store/goods/form_style'}
<div class="think-box-shadow">
    {include file='store/goods_models/index_search'}
    <table class="layui-table margin-top-10" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <input data-auto-none data-check-target='.list-check-box' type='checkbox'>
            </th>
            <th class='list-table-sort-td'>
                <button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
            </th>
            <th>产品名称</th>
            <th>型号名称</th>
            <th>图片</th>
            <th>排序</th>
            <th>状态</th>
            <th>操作</th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr data-dbclick>
            <td class='list-table-check-td think-checkbox'><input class="list-check-box" value='{$vo.id}' type='checkbox'></td>
            <td class='list-table-sort-td'><input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.sort}" class="list-sort-input"></td>
            <td>{$vo.goods ? $vo.goods.title : ''}</td>
            <td>{$vo.name}</td>
            <td>
                {notempty name='vo.thumb'}
                <img data-tips-image style="width:60px;height:60px" src="{$vo.thumb|default=''}" class="margin-right-5 text-top">
                {/notempty}
            </td>
            <td class='text-left nowrap'>
                {$vo.sort}
            </td>
            <td>
                <div class="layui-row">
                    <div class="layui-col-xs2 text-center font-s10">
                        {if isset($vo.status) and $vo.status eq 1}
                       
                        <a class="layui-btn layui-btn-sm" data-action="{:url('forbid')}" data-value="id#{$vo.id};status#0">上架中</a>
                     
                        
                        {else}
                       
                        <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('resume')}" data-value="id#{$vo.id};status#1">已下架</a>
                       
                        {/if}

                    </div>
                </div>
            </td>

            <td class='text-left nowrap'>

                <div class="nowrap margin-bottom-5">
     
                    <a data-dbclick class="layui-btn layui-btn-sm" data-width="1200px" data-height="80%" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
                   
  
                    <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除数据吗?" data-action="{:url('remove')}" data-value="id#{$vo.id}">删 除</a>
                
 
                </div>


            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>

    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}

</div>
{/block}
